package org.uni_hi.lsep.gui.util;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JTextField;
import javax.swing.plaf.metal.MetalComboBoxEditor;

public class VTFEditor extends MetalComboBoxEditor{

	public VTFEditor(){
		getEditorComponent().addFocusListener(new FocusListener() {
			
			@Override
			public void focusLost(FocusEvent e) {}
			
			@Override
			public void focusGained(FocusEvent e) {
				getEditorComponent().selectAll();
			}
		});
	}
	
	public void selectAll(){
		getEditorComponent().selectAll();
	}
	
	public JTextField getEditorComponent(){
		return (JTextField) super.getEditorComponent();
	}
	
	public boolean verify(){
		return getEditorComponent().getInputVerifier().verify(getEditorComponent());
	}
}
